home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / dev / gui / gtlayout.lha / Source / LT_PressButton.c < prev    next >
C/C++ Source or Header  |  1998-09-09  |  2KB  |  75 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1998 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16. /****** gtlayout.library/LT_PressButton ******************************************
  17. *
  18. *   NAME
  19. *    LT_PressButton -- Highlight a button so it looks as if the user
  20. *                      has selected it.
  21. *
  22. *   SYNOPSIS
  23. *    Success = LT_PressButton(Handle,ID);
  24. *       D0                       A0  D0
  25. *
  26. *    BOOL LT_PressButton(LayoutHandle *,LONG);
  27. *
  28. *        NOTE: The return value did not exist until V39!
  29. *
  30. *   FUNCTION
  31. *    You can provide visual feedback for BUTTON_KIND objects by calling
  32. *    this routine. They will briefly appear to be selected and then
  33. *    fall back to their original states.
  34. *
  35. *    As of V39 and beyond this function will indicate whether the button
  36. *    could be highlighted or not.
  37. *
  38. *   INPUTS
  39. *    Handle - Pointer to LayoutHandle structure
  40. *
  41. *    ID - ID of button object to highlight
  42. *
  43. *   RESULT
  44. *    Success (V39) - TRUE if button could be highlighted, FALSE otherwise.
  45. *
  46. ******************************************************************************
  47. *
  48. */
  49.  
  50. BOOL LIBENT
  51. LT_PressButton(REG(a0) LayoutHandle *handle,REG(d0) LONG id)
  52. {
  53.     BOOL Result;
  54.  
  55.     Result = FALSE;
  56.  
  57.     if(handle)
  58.     {
  59.         struct Gadget *gadget;
  60.  
  61.         if(gadget = LTP_FindGadget(handle,id))
  62.         {
  63.             ObjectNode *node;
  64.  
  65.             if(GETOBJECT(gadget,node))
  66.             {
  67.                 if(!node->Disabled)
  68.                     Result = LTP_BlinkButton(handle,gadget);
  69.             }
  70.         }
  71.     }
  72.  
  73.     return(Result);
  74. }
  75.